package com.example.demo.mapper;

import com.example.demo.entity.Book;
import com.example.demo.sharding.RouteModel;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface BookMapper {

    /**
     * 从默认数据源中查询列表
     *
     * @return
     */
    List<Book> list();

    /**
     * 从RouteModel中指定的数据源和表中查询列表
     *
     * @param routeModel
     * @return
     */
    List<Book> listByRout(@Param("routeModel") RouteModel routeModel);

    Book findByRout(@Param("routeModel") RouteModel routeModel);

}
